home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / white.arc / MVPDOSV3.4TH < prev    next >
Text File  |  1986-11-07  |  18KB  |  546 lines

  1. \ <PAGEW> clear video utility                         13Dec83RSW
  2.         FORTH DEFINITIONS DECIMAL
  3.  
  4. ( <PAGEW> -- SETS 80 COLUMN B&W MODE FOR COLOR GRAPHICS ADPTR )
  5.  
  6. : <PAGEW>  2 0 0 0 16 INTCALL DROP ;
  7.  
  8.    FIND <PAGEW> 'PAGE !         ( update init video vector )
  9.    FREEZE
  10.  
  11. : BEEP  7 EMIT ;  \ alert operator utility
  12.  
  13.  
  14.  
  15.  
  16.  
  17. \ MYSELF ASCII BEEP                                   17Dec83RSW
  18.             FORTH DEFINITIONS DECIMAL
  19.  
  20. : MYSELF  LATEST PFA CFA , ; IMMEDIATE \ recurse do current word
  21.  
  22. : ASCII  BL WORD 1+ C@ STATE @  \ convert next char to ASCII
  23.    IF [COMPILE] LITERAL
  24.    THEN ;  IMMEDIATE
  25.  
  26. : BEEP   7 EMIT ;
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33. \                                                     17Dec83RSW
  34.         EXIT
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49. \ .B CARRAY ARRAY STRING                              17Dec83RSW
  50.             FORTH DEFINITIONS DECIMAL
  51.  
  52. : .B BASE @ DUP ." Now in base " DECIMAL . CR BASE ! ;
  53.  
  54. : CARRAY ( # bytes --- )  ( # --- addr )
  55.          CREATE 1+ ALLOT DOES> + ;
  56.  
  57. : ARRAY  ( # words --- )  ( # --- addr )
  58.          CREATE 1+ 2* ALLOT DOES> SWAP 2* + ;
  59.  
  60. : STRING  ( N-MAX --> )
  61.    CREATE 1 MAX 255 MIN
  62.     DUP C, 0 C, ALLOT
  63.    DOES> 1+ COUNT ;
  64.  
  65. \ FLEN  return length of a string                     06Nov83RSW
  66.         DECIMAL
  67.  
  68. : FLEN ( addr --- count ) \  return length of string
  69.  255 0
  70.  DO
  71.    DUP I +
  72.    C@ 0=
  73.    IF
  74.      I LEAVE
  75.    THEN
  76.  LOOP
  77.  SWAP DROP ;
  78.  
  79.  
  80.  
  81. \ ACCEPT LEN MLEN S! string manipulation stuff        13Dec83RSW
  82.         FORTH DEFINITIONS DECIMAL
  83. : ACCEPT  ( string --- ) \ transfer chars from term to string
  84.    DROP 1- DUP 1- @ OVER 1+ DUP ROT ( addr-1 addr addr n --- )
  85.    EXPECT
  86.    FLEN
  87.    SWAP C! ;
  88.  
  89. : LEN   SWAP DROP ; ( string --- string-current-length )
  90. : MLEN  DROP 2- C@ ; ( string --- string-max-length )
  91.  
  92. : S!  ( string1 string2 --- ) \ stores string1 into string2
  93.    DROP DUP 2- C@
  94.    ROT MIN DUP 3 PICK 1- C! CMOVE ;
  95.  
  96.  
  97. \ <"> " ILINE NULL$      string manipulation stuff    06Nov83RSW
  98.  
  99. : <">
  100.     R@ COUNT DUP 1+ R> + >R ;
  101.         HEX
  102. : "
  103.    22   \ push terminator " onto stack
  104.    STATE @ IF
  105.         COMPILE <"> WORD C@ 1+ ALLOT
  106.    ELSE
  107.         TEXT PAD COUNT
  108.    THEN ;  IMMEDIATE   DECIMAL
  109.  
  110.  
  111. 82 STRING ILINE
  112. 0 STRING NULL$
  113. \ MID$ RIGHT$ LEFT$ VAL CHR$ ASC SUB!                 06Nov83RSW
  114.         DECIMAL
  115. : MID$
  116.     >R OVER MIN 1 MAX 1-
  117.     SWAP OVER - R> MIN >R + R> ;
  118. : RIGHT$
  119.     OVER 1+ SWAP - 255 MID$ ;
  120. : LEFT$
  121.     1 SWAP MID$ ;
  122. : VAL
  123.     >R PAD 1+ R@ CMOVE R@ PAD C!
  124.     0 PAD 1+ R> + C!
  125.     PAD NUMBER ;
  126. : CHR$  PAD ! PAD 1 ;
  127. : ASC  DROP C@ ;
  128. : SUB!  ROT MIN 0 MAX CMOVE ;
  129. \ S= compare two strings for equality                 06Nov83RSW
  130.  
  131. : S=
  132.    ROT OVER = IF
  133.      ?DUP IF
  134.        1 SWAP 0 DO
  135.          DROP OVER C@ OVER C@ = IF
  136.            1+ SWAP 1+ SWAP 1
  137.          ELSE 0 LEAVE
  138.          THEN
  139.        LOOP
  140.      ELSE 1
  141.      THEN
  142.    ELSE DROP 0
  143.    THEN
  144.    SWAP DROP SWAP DROP ;
  145. \ S< compare two strings for alphabetic order         13Dec83RSW
  146.  
  147. : S<    ( str1 str2 --- f ) \ true if str1 lower than str2
  148.    ROT OVER MIN SWAP OVER > >R ?DUP IF
  149.      -1 SWAP 0 DO
  150.        DROP OVER C@ OVER C@ = IF
  151.          1+ SWAP 1+ SWAP -1
  152.        ELSE C@ SWAP C@ > LEAVE
  153.        THEN
  154.      LOOP DUP 0< IF
  155.        2DROP DROP R>
  156.      ELSE R> DROP
  157.      THEN
  158.    ELSE 2DROP R>
  159.    THEN ;
  160.  
  161. \ S+ STR$ STRING-ARRAY                                06Nov83RSW
  162.  
  163. : S+
  164.    >R OVER R@ + OVER 2- C@ MIN OVER OVER
  165.    SWAP 1- C! R> 1+ 255 MID$ SUB! ;
  166.  
  167. : STR$
  168.    SWAP OVER DABS
  169.    <# #S ROT SIGN #> ;
  170.  
  171. : STRING-ARRAY
  172.    CREATE 0 DO
  173.        DUP C, 0 C, DUP ALLOT
  174.      LOOP
  175.    DOES>
  176.      DUP C@ 2+ ROT * + 1+ COUNT ;
  177. : IN$ ( str1 str2 --- npos ) \ finds position of str1 13Dec83RSW
  178.    DUP 4 PICK - DUP 0> IF
  179.      SWAP OVER - IF
  180.        0 SWAP 2+ 1 DO
  181.          DROP 3 PICK C@ OVER C@ = IF
  182.            3 PICK 3 PICK 3 PICK OVER S= IF
  183.              I LEAVE
  184.            ELSE 1+ 0
  185.            THEN
  186.          ELSE 1+ 0
  187.          THEN
  188.        LOOP
  189.      ELSE DROP 0
  190.      THEN >R 2DROP DROP R>
  191.    ELSE DROP S=
  192.    THEN ;
  193. \ GET$ INPUT$ GET INPUT operator input of data        13Dec83RSW
  194.         HEX
  195. : GET$  ( n-width --- str ) \ fetch kybd chars into string
  196.     PAD                     \ string length limit set by n-width
  197.     1+ DUP ROT EXPECT FLEN PAD C! PAD COUNT ;
  198.  
  199. : INPUT$  ( --- str )   \ fetch up 80 char string from kybd
  200.     50 GET$ ;
  201.  
  202. : GET ( n-width --- dn )  \ fetch double number from kybd
  203.     GET$ VAL ;            \ inpu field width set by n-width
  204.  
  205. : INPUT ( --- dn )      \ fetch double number from kybd
  206.     50 GET ;
  207.                 DECIMAL
  208.  
  209. \ RECLEN FCBLEN DBUFSIZE FCB - DOS file interface     16Nov83RSW
  210.         FORTH DEFINITIONS DECIMAL
  211.  
  212. 128 CONSTANT RECLEN     \ DOS disk file record length
  213.  
  214. 37 CONSTANT FCBLEN      \ DOS file control block length
  215.  
  216. RECLEN FCBLEN + CONSTANT DBUFSIZE  \ total FCB&data buffer size
  217.  
  218. : FCB  ( usage "FCB fcb-name" ) \ builds file control block
  219.    CREATE
  220.         HERE  DBUFSIZE ERASE  DBUFSIZE ALLOT
  221.    DOES> ;
  222.  
  223.  
  224.  
  225. \ DSKADR@ SETDMA FILEOP FILEOP2 - DOS file interface  15Nov83RSW
  226. : DSKADR@  ( fcb-addr -- disk-data-addr )
  227.    FCBLEN + ;       \ fetch address of corresponding data buffer
  228.  
  229. : SETDMA   ( fcb-addr -- )   \ set up disk file transfer address
  230.    26 SWAP  ( function-code fcb-addr -- )
  231.    DSKADR@  ( function-code disk-data-addr -- )
  232.    SYSCALL DROP ; \ do DOS function & drop status
  233.  
  234. : FILEOP  ( fcb-addr dos-function-code -- DOS-file-status )
  235.    SWAP SYSCALL 255 AND ;  ( normally 0 for no error )
  236. : FILEOP2  FILEOP DUP 0= IF \ do file operation - error?
  237.      DROP DSKADR@           \  no - return start of data address
  238.    ELSE
  239.      SWAP DROP              \  yes - return error code
  240.    THEN ;
  241. \ CLOSEF SEARCHF NEXTF KILLF READF WRITEF - DOS file  16Nov83RSW
  242. : OPENF  ( fcb-addr -- status )  \ open an existing file
  243.     DUP 15 FILEOP             \ do DOS file open
  244.     SWAP 14 + RECLEN SWAP ! ; \ set record length into fcb
  245. : CLOSEF    16 FILEOP ; \ close file after writing
  246. : SEARCHF   17 FILEOP ; \ search directory for a file
  247. : NEXTF     18 FILEOP ; \ search directory for next file
  248. : KILLF     19 FILEOP ; \ wipe out mention of a file
  249.  
  250. : READF  ( fcb-addr -- data-addr/error) \ read next file record
  251.     DUP DUP SETDMA       \ set up data transfer address
  252.     20 FILEOP2 ;         \ read next record.  4 < is an error
  253.  
  254. : WRITEF ( fcb-addr -- data-addr/error) \ write next file record
  255.     DUP DUP SETDMA       \ set up data transfer address
  256.     21 FILEOP2 ;         \ write next record   3 < is an error
  257. \ CREATEF RENAMEF FILEOP3 READFR WRITEFR - DOS file   14Nov83RSW
  258. : CREATEF ( fcb-addr -- status) \ create a new flie
  259.     DUP 22 FILEOP               \ do DOS file creation
  260.     SWAP 14 + RECLEN SWAP ! ;   \ set record length into fcb
  261. : RENAMEF      ( fcb-addr -- status ) \ rename a file
  262.     23 FILEOP ; ( NOTE: new name at fcb-addr+17 )
  263.  
  264. : FILEOP3  OVER 33 + !  DUP DUP SETDMA ;
  265.  
  266. : READFR  ( fcb-addr record-number -- data-addr/error )
  267.     FILEOP3             \ prepare for random file operation
  268.     33 FILEOP2 ;        \ read a record randomly
  269.  
  270. : WRITEFR  ( fcb-addr record-number -- data-addr/error )
  271.     FILEOP3             \ prepare for random file operation
  272.     34 FILEOP2 ;        \ write a record randomly
  273. \ DO-TYPE  last part of PREP-FCB - DOS file interface 15Nov83RSW
  274.  
  275. : DO-TYPE
  276.     DUP C@ ASCII . = IF         \ file type specified?
  277.       SWAP 8 + SWAP 1+          \  yes - fetch it
  278.       3 0 DO
  279.         DUP C@ DUP ASCII ! < IF \ end of file type?
  280.           DROP LEAVE            \  yes - move on
  281.         ELSE
  282.           3 PICK I + C! 1+      \  no - move type char into fcb
  283.         THEN
  284.       LOOP
  285.     THEN
  286.     DROP 5 +  ( fcb-addr+14 -- )
  287.     RECLEN SWAP ! ;             \ set up record length & exit
  288.  
  289. \ PREP-FCB   DOS file interface cont                  15Nov83RSW
  290. : PREP-FCB   ( fcb-addr filename-addr -- )
  291.     OVER DUP FCBLEN ERASE 1+ 11 BLANK \ null&blank out fcb&buff
  292.     DUP 1+ C@ ASCII : = IF            \ drive specifier?
  293.       DUP C@ ASCII @ -                \  yes - fetch as binary #
  294.       1 MAX 2 MIN 3 PICK C! 2+        \ store only valid range
  295.     THEN         ( fcb-addr filename-addr -- )
  296.     SWAP 1+ SWAP
  297.     8 0 DO                            \ move name char into fcb
  298.       DUP C@ DUP ( fcb-addr+1 filename-addr char char -- )
  299.       ASCII . = OVER ASCII ! < OR IF  \ name field terminator?
  300.         DROP LEAVE                    \  yes - move on
  301.       ELSE
  302.         3 PICK I + C! 1+              \  no - store name char
  303.       THEN
  304.     LOOP   DO-TYPE ;
  305. \ FCTRLZ  truncates string at any control-Z            7Nov83RSW
  306.         FORTH DEFINITIONS DECIMAL
  307. 1 STRING EOF  26 CHR$ EOF S!    \ define end-of-file string char
  308.  
  309. : FCTRLZ         ( addr1 len1 --- )
  310.    EOF           ( addr1 len1 addr2 len2 --- )
  311.    4 PICK 4 ROLL ( addr1 addr2 len2 addr1 len1 --- )
  312.    IN$           ( addr1 npos --- )
  313.    ?DUP 0> IF    ( addr1 ?npos --- )    \ any EOF's?
  314.      1- SWAP 1-  ( npos-1 addr1-1 --- )
  315.      C!                                 \  yes - truncate length
  316.    ELSE
  317.      DROP
  318.    THEN ;
  319.  
  320.  
  321. \ FILE1 SEE1  test DOS disk file interface            16Nov83RSW
  322.         FORTH DEFINITIONS DECIMAL
  323. FCB FILE1
  324. RECLEN STRING OBUF
  325. : SEE1          \ define & display FILE1
  326.     FILE1 CR ." file to display? " INPUT$ DROP PREP-FCB
  327.     CR FILE1 OPENF 255 = IF
  328.       ." can't open file " ABORT
  329.     THEN
  330.     BEGIN
  331.       FILE1 READF DUP 3 >
  332.     WHILE
  333.       RECLEN OBUF S! OBUF FCTRLZ OBUF TYPE  \ process file data
  334.     REPEAT
  335.     DROP FILE1 CLOSEF 255 = IF CR ." close error"
  336.       THEN QUIT ;
  337. \ screens to DOS file variables & constants           15Nov83RSW
  338.         FORTH DEFINITIONS DECIMAL
  339. VARIABLE DSKPOS         \ char position in disk buffer
  340. VARIABLE FEND           \ end of DOS file flag
  341. VARIABLE CHARPOS        \ char position in line buffer
  342. 2 STRING CRLF 13 CHR$ CRLF S! 10 CHR$ CRLF S+ \ CR LF string
  343. 1 STRING TAB 9 CHR$ TAB S!      \ TAB string
  344. 8 CONSTANT TABMOD       \ TAB modulus
  345. VARIABLE SCRLIM         \ screen limit storage
  346. VARIABLE LINE-COMPRESS  \ line compression flag
  347. VARIABLE TAB-COMPRESS   \ tab compression flag
  348. VARIABLE SCRLINE        \ screen line #
  349. 16 CONSTANT LINE-SCR    \ lines per screen
  350. 9 STRING SCR-SEP        \ screen seperator string
  351. NULL$ SCR-SEP S!        \ initialize screen seperator string
  352. VARIABLE BLKADR         \ current block address pointer storage
  353. \ PUTLINE puts line into disk buff-scrns to DOS cont. 16Nov83RSW
  354.  
  355. : PUTLINE
  356.    ILINE LEN 0> IF                        \ any char in string?
  357.      0 CHARPOS ! BEGIN                    \  yes - doit
  358.        ILINE DROP CHARPOS @ + C@          \ fetch char from line
  359.        FILE1 DSKADR@ DSKPOS @ + C!        \ store char to dskbuf
  360.        1 DSKPOS +! DSKPOS @ RECLEN = IF   \ incr dskpos - full?
  361.          FILE1 WRITEF 3 < IF              \  yes-write disk buf
  362.            CR BEEP ABORT" disk full" THEN \    write error exit
  363.          0 DSKPOS !                       \ reset disk char pos
  364.        THEN
  365.        1 CHARPOS +!                       \ bump string char pos
  366.        CHARPOS @ ILINE LEN =  \ loop until char pos = string len
  367.      UNTIL
  368.    THEN ;
  369. \ COMPRESS spaces out of line buff-scrns to DOS cont.  8Nov83RSW
  370.  
  371. : COMPRESS
  372.         LINE-COMPRESS @ 0> IF   \ compression turned on ?
  373.           ILINE -TRAILING SWAP 1- C! \ yes - delete trail spaces
  374.           CRLF ILINE S+         \ add carriage-return linefeed
  375.           TAB-COMPRESS @ 0> IF  \ compress spaces to tabs?
  376.             1 DROP              \  yes - add tab compress here
  377.           THEN
  378.         THEN ;
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385. \ WRITE-OPEN    screens to DOS continued              15Nov83RSW
  386.  
  387.         \ warning - the filename string must end with a null !
  388.  
  389. : WRITE-OPEN           ( filename-str --- )
  390.    DROP DUP FILE1 SWAP ( filename-addr fcb filename-addr --- )
  391.    PREP-FCB            ( filename-addr --- )    \ prepare fcb
  392.    FILE1 KILLF DROP                \ kill any previous file
  393.    FILE1 SWAP PREP-FCB     ( --- ) \ re-prepare fcb
  394.    FILE1 CREATEF 255 = IF          \ open file - error ?
  395.      BEEP CR ABORT" can't make new file " \ yes - give up
  396.    THEN
  397.    0 DSKPOS !           \ intialize disk buffer offset pointer
  398.    ;
  399.  
  400.  
  401. \ FETCH-SCR FETCH-LINE screens to DOS continued        8Nov83RSW
  402.  
  403. : FETCH-SCR        \ fetches screen # stored in SCR into a BLOCK
  404.    SCR @ BLOCK           ( blk-addr --- )
  405.    BLKADR !              \ intialize block address storage
  406.    SCR-SEP ILINE S!      \ put screen seperator into line buffer
  407.    PUTLINE               \ write screen seperator to disk file
  408.    0 SCRLINE !           \ intialize screen line counter
  409.    1 SCR +! ;            \ update scr # to next screen
  410.  
  411. : FETCH-LINE      \ fetches line out of a block into line buffer
  412.    BLKADR @ C/L ILINE S!  \ fetch line into line buffer
  413.    C/L BLKADR +!          \ update buffer address to next line
  414.    1 SCRLINE +! ;         \ update line # to next line
  415.  
  416.  
  417. : SCRNS->DOS ( first-scr last-scr filename-str ---) \ 17Dec83RSW
  418.    WRITE-OPEN  SCRLIM !  SCR ! CR     \ set up file & scr stuff
  419.    BEGIN SCR @ . 13 EMIT FETCH-SCR    \ get next scr into block
  420.      BEGIN  FETCH-LINE                \ get next line from block
  421.        COMPRESS                       \ do any line compression
  422.        PUTLINE                        \ write line to DOS file
  423.        SCRLINE @ LINE-SCR =           \  till all scr lines done
  424.      UNTIL
  425.      SCR @ SCRLIM @ >                 \  till all scrns done
  426.    UNTIL
  427.    EOF ILINE S!  PUTLINE              \ put ^Z into DOS file
  428.    FILE1 WRITEF 3 < IF                \ write last part of file
  429.      BEEP CR ABORT" disk full" THEN
  430.    FILE1 CLOSEF 255 = IF              \ update DOS directory
  431.      BEEP CR ABORT" close error" THEN
  432.    CR ." screen(s) transfered OK " CR ;
  433. \ SEND-SCRNS transfers standard screens to DOS file    8Nov83RSW
  434.  
  435. 15 STRING OFILE$
  436.  
  437. : SEND-SCRNS
  438.    CR ." enter 1 to compress lines "
  439.      INPUT DROP LINE-COMPRESS !
  440.    CR ." enter 1 to compress spaces with tabs "
  441.      INPUT DROP TAB-COMPRESS !
  442.    CR ." first screen # ? " INPUT DROP
  443.    CR ." last screen # ? " INPUT DROP
  444.    CR ." desired DOS screen filename ? " INPUT$
  445.    OFILE$ S!
  446.    OFILE$ SCRNS->DOS ;
  447.  
  448.  
  449. \ PROC-CHAR process char into line buffer             19Nov83RSW
  450. VARIABLE MAXCHAR  0 MAXCHAR !
  451. : PROC-CHAR                ( char --- )
  452.      DUP 13 = IF                        \ carriage return?
  453.        DROP MAXCHAR @ IF 0 MAXCHAR ! ELSE \ yes-skip if line ful
  454.          C/L CHARPOS @ -                   \ # blanks to write
  455.          ILINE DROP CHARPOS @ + SWAP BLANK \ write blanks
  456.          C/L CHARPOS ! THEN                \ max char counter
  457.      ELSE DUP 10 = IF DROP              \ linefeed? yes - skip
  458.        ELSE DUP 26 = IF                 \ end-of-file?
  459.            1 FEND ! DROP 13 MYSELF \ yes-set end & recurse a CR
  460.          ELSE                      \ no-store char & bump count
  461.            ILINE DROP CHARPOS @ + C!   1 CHARPOS +!
  462.            C/L CHARPOS @ = IF      \ at max char?
  463.              1 MAXCHAR ! THEN      \  yes - set flag
  464.      THEN THEN THEN ;
  465. \ GETLINE gets a screen line from DOS file buffer     16Nov83RSW
  466. : GETLINE
  467.    0 CHARPOS !                      \ initialize line char count
  468.    BEGIN
  469.      FILE1 DSKADR@ DSKPOS @ + C@        \ fetch file char
  470.      PROC-CHAR                          \ put char in line buff
  471.      1 DSKPOS +!                        \ bump disk buff pos
  472.      DSKPOS @ RECLEN = IF               \ finished disk buffer?
  473.        FILE1 READF 4 < IF               \  yes-read more - done
  474.          1 FEND !                       \    yes - set done flag
  475.          13 PROC-CHAR                   \         finish up line
  476.        THEN
  477.        0 DSKPOS !                       \ reset disk buff pos
  478.      THEN
  479.      CHARPOS @ C/L = FEND @ OR          \ till line or file done
  480.    UNTIL   C/L ILINE DROP 1- C! ;       \ set line length
  481. \ READ-OPEN    DOS to screens continued               19Nov83RSW
  482.         \ warning - the filename string must end with a null !
  483. : READ-OPEN            ( filename-str --- )
  484.    DROP FILE1 SWAP     ( fcb filename-addr --- )
  485.    PREP-FCB            ( --- )       \ prepare fcb
  486.    FILE1 OPENF 255 = IF              \ open file - error ?
  487.      BEEP CR ABORT" can't open file" \   yes - give up
  488.    THEN
  489.    FILE1 READF 4 < IF   \ get first record - none?
  490.      BEEP CR ABORT" null length file "     \   yes - give up
  491.    THEN
  492.    0 DSKPOS !           \ intialize disk buffer offset pointer
  493.    0 MAXCHAR ! ;        \ intialize filled line flag
  494.  
  495.  
  496.  
  497. \ LINEPUT  NEXT-SCR    DOS to screens cont.           13Nov83RSW
  498.  
  499. : LINEPUT               ( --- )
  500.     ILINE DROP BLKADR @ C/L CMOVE \ put line buff in block buff
  501.     C/L BLKADR +!         \ update current block addr
  502.     ;
  503.  
  504. : NEXT-SCR
  505.     SCR @ BLOCK  ( blk-addr --- ) \ fetch next block
  506.     DUP BLKADR !                  \ intialize block address
  507.     UPDATE                        \ mark as modified
  508.     LINE-SCR C/L * BLANK          \ blank out block
  509.     1 SCR +!                      \ point to next screen
  510.     ;
  511.  
  512.  
  513. \ DOS->SCRNS  DOS file to FORTH screens transfer      11Nov83RSW
  514.  
  515. : DOS->SCRNS ( first-scr filename-str --- ) \
  516.   READ-OPEN SCR !  0 FEND ! \ open DOS file & set variables
  517.   BEGIN  NEXT-SCR       \ fetch next screen blk
  518.     LINE-SCR 0 DO       \ write appropiate # lines into scre
  519.       GETLINE           \ fetch line out of file buffer
  520.       LINEPUT           \ put line into block buffer
  521.       FEND @ IF         \ found DOS file end?
  522.         LEAVE           \  yes - exit now
  523.       THEN
  524.     LOOP
  525.     FEND @              \  till DOS file end
  526.   UNTIL
  527.   FLUSH CR ." finished. Last screen was "
  528.   SCR @ 1 - DUP SCR ! . CR ;
  529. \ GET-SCRNS transfers DOS file to standard screens    10Nov83RSW
  530.  
  531. : GET-SCRNS
  532.    CR ." first screen # ? " INPUT DROP
  533.    CR ." desired DOS screen filename ? " INPUT$
  534.    OFILE$ S!
  535.    OFILE$ DOS->SCRNS ;
  536.  
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544.  
  545. een # ? " INPUT DROP
  546.    CR ."